package com.swanclouds.redfish.chassis.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.swanclouds.redfish.common.redfish.MemberModel;

import java.util.List;

public class Link {

    @JsonProperty("PCIeDevices@odata.count")
    private String pCIeDevicesOdataCount;

    @JsonProperty("PCIeDevices")
    private List<MemberModel> pCIeDevices;

    @JsonProperty("NetworkPorts@odata.count")
    private String networkPortsOdataCount;

    /**指定网络适配器的相关网络端口对象集合**/
    @JsonProperty("NetworkPorts")
    private List<MemberModel> networkPorts;

    @JsonProperty("Drives")
    private List<MemberModel> drives;

    public List<MemberModel> getDrives() {
        return drives;
    }

    public String getpCIeDevicesOdataCount() {
        return pCIeDevicesOdataCount;
    }

    public List<MemberModel> getpCIeDevices() {
        return pCIeDevices;
    }

    public String getNetworkPortsOdataCount() {
        return networkPortsOdataCount;
    }

    public List<MemberModel> getNetworkPorts() {
        return networkPorts;
    }

    @Override
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
        }
        return "Link{" +
                "PCIeDevices@odata.count='" + pCIeDevicesOdataCount + '\'' +
                "PCIeDevices='" + pCIeDevices + '\'' +
                "NetworkPorts@odata.count='" + networkPortsOdataCount + '\'' +
                "NetworkPorts='" + networkPorts + '\'' +
                "Drives='" + drives + '\'' +
                '}';
    }
}
